Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

pre-commit

Package Overview
Dependencies
Maintainers
3
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pre-commit

Automatically install pre-commit hooks for your npm modules.

  • 1.2.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
295K
decreased by-9.02%
Maintainers
3
Weekly downloads
 
Created

What is pre-commit?

The pre-commit npm package allows you to easily manage and run scripts before committing code to a repository. It helps enforce code quality and consistency by running tasks such as linting, testing, and formatting before the commit is finalized.

What are pre-commit's main functionalities?

Running Linting Scripts

This feature allows you to run linting scripts before committing code. The provided code sample configures the pre-commit hook to run ESLint on all files in the repository.

{
  "scripts": {
    "precommit": "eslint ."
  }
}

Running Tests

This feature allows you to run tests before committing code. The provided code sample configures the pre-commit hook to run the tests defined in the npm test script.

{
  "scripts": {
    "precommit": "npm test"
  }
}

Running Multiple Scripts

This feature allows you to run multiple scripts before committing code. The provided code sample configures the pre-commit hook to run both linting and testing scripts sequentially.

{
  "scripts": {
    "precommit": "npm run lint && npm test"
  }
}

Other packages similar to pre-commit

Keywords

FAQs

Package last updated on 13 Dec 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc